package com.firexxx.vp.domain.semantic;

import com.firexxx.common.domain.AbstractEntity;
import com.firexxx.vp.domain.audio.AudioEntity;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @description: TODO
 * @throws:
 * @author: zhuangzhang2
 * @date: 2019/12/19 09:11
 */
@Entity
@Table(name = "semantic")
@DynamicInsert
@DynamicUpdate
@Where(clause = "is_deleted = false")
@Getter
@NoArgsConstructor(access = AccessLevel.PACKAGE)
@Slf4j
public class SemanticEntity extends AbstractEntity {

    @NotNull
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "audio_id", referencedColumnName = "id")
    private AudioEntity audioEntity;

    @NotNull
    @Column
    private String sid;

    @NotNull
    @Column
    private String intent;
}